/*
 */

package com.core.basic.secure.domain;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;
import common.base.*;
import common.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.util.page.*;
import cn.org.rapid_framework.page.*;


import com.core.basic.secure.domain.*;
import com.core.basic.secure.dao.*;
import com.core.basic.secure.service.*;
import com.core.basic.secure.query.*;

/**
 */


public class Menu implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Menu";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_NAME = "name";
	public static final String ALIAS_LINK = "link";
	public static final String ALIAS_LEVEL = "level";
	public static final String ALIAS_PARENT_ID = "parentId";
	public static final String ALIAS_NOTE = "note";
	public static final String ALIAS_RESOURCE_NAME = "resourceName";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@Length(max=45)
	private java.lang.String name;
	@Length(max=45)
	private java.lang.String link;
	@Length(max=45)
	private java.lang.String level;
	
	private java.lang.Integer parentId;
	@Length(max=45)
	private java.lang.String note;
	@Length(max=45)
	private java.lang.String resourceName;
	//columns END

	public Menu(){
	}

	public Menu(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setLink(java.lang.String value) {
		this.link = value;
	}
	
	public java.lang.String getLink() {
		return this.link;
	}
	public void setLevel(java.lang.String value) {
		this.level = value;
	}
	
	public java.lang.String getLevel() {
		return this.level;
	}
	public void setParentId(java.lang.Integer value) {
		this.parentId = value;
	}
	
	public java.lang.Integer getParentId() {
		return this.parentId;
	}
	public void setNote(java.lang.String value) {
		this.note = value;
	}
	
	public java.lang.String getNote() {
		return this.note;
	}
	public void setResourceName(java.lang.String value) {
		this.resourceName = value;
	}
	
	public java.lang.String getResourceName() {
		return this.resourceName;
	}
	
	private Set menus = new HashSet(0);
	public void setMenus(Set menus){
		this.menus = menus;
	}
	
	public Set getMenus() {
		return menus;
	}
	
	private Menu menu;
	
	public void setMenu(Menu menu){
		this.menu = menu;
	}
	
	public Menu getMenu() {
		return menu;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Name",getName())
			.append("Link",getLink())
			.append("Level",getLevel())
			.append("ParentId",getParentId())
			.append("Note",getNote())
			.append("ResourceName",getResourceName())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Menu == false) return false;
		if(this == obj) return true;
		Menu other = (Menu)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

